<?php 
class SiteZone extends Object
{
	public $SiteId;
	public $Title;
	public $Handle;
	public $Inheritable;
	public $Active;
	
	public function SiteZone($values = '')
	{ 
		self::setDataTable('site_zones');
		if(is_array($values))
		{ self::setValues($values); }
	}
	
	public function getSiteId() { return intval($this->SiteId); }
	public function getInheritable() { return intval($this->Inheritable); }
	
	public function setSiteId($val) { $this->SiteId=intval($val); }
	public function setInheritable($val) { $this->Inheritable=intval($val); }
	
	function update()
	{
		if((self::getId() > 0) && (self::getDataChanged()))
		{
			$sql  = 'UPDATE '.DB_PERFIX.self::getDataTable().' SET ';
			$sql .= '`siteId`='.self::getSiteId().', ';
			$sql .= '`title`="'.self::formatText(self::getTitle()).'", ';
			$sql .= '`handle`="'.self::formatText(self::getHandle()).'", ';
			$sql .= '`inheritable`='.self::getInheritable().', ';
			$sql .= '`active`='.self::getActive().' ';
			$sql .= ' WHERE id='.self::getId().' LIMIT 1;';
			mysql_query($sql);
		}
	}
}
?>